#include "Ball.h"
#include "DirectX\Model.h"
#include "DirectX\Device.h"
#include "DirectX\ModelResourceManager.h"
#include "DirectX\TextureResourceManager.h"

using namespace Graphics;

RTTI_DEFINITIONS(Ball)

Ball::Ball(void)
	:Graphics::RenderableEntity()
{
	D3DDevice* nDevice = GetPlatform()->GetDevice()->As<D3DDevice>();
	mModel = ModelResourceManager::GetInstance()->GetResource("Sphere");
	if(mModel)
	{
		Texture* texture = TextureResourceManager::GetInstance()->GetResource("SeaFloor");
		mModel->SetTexture(texture);
	}
}

Ball::~Ball(void)
{
}

void Ball::Update(float gameTime)
{
	Graphics::RenderableEntity::Update(gameTime);
	if(mModel)
	{
		mModel->Update(gameTime);
	}
}
void Ball::Render()
{
	Graphics::RenderableEntity::Render();
	if(mModel)
	{
		mModel->Render();
	}
}